package org.jetlinks.pro.assets;

import org.hswebframework.web.dict.EnumDict;

import java.util.stream.Stream;

/**
 * 资产权限,单个资产的权限不能超过64个.
 * 建议使用枚举实现此接口
 *
 * @author zhouhao
 * @since 1.2
 */
public interface AssetPermission extends EnumDict<String> {


    static AssetPermission[] merge(AssetPermission[] permissions, AssetPermission... more) {
        return Stream
            .concat(
                Stream.of(permissions),
                Stream.of(more)
            )
            .distinct()
            .toArray(AssetPermission[]::new);
    }
}
